package com.example.costumview.customview;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;

import androidx.annotation.Nullable;

public class AnimProgressive3View extends View {
    private static final String TAG = "AnimProgressive2View";
    private Paint mPaint;


    public AnimProgressive3View(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    private void init() {
        mPaint = new Paint();
        mPaint.setColor(Color.RED);
        mPaint.setStrokeWidth(8);
        mPaint.setStyle(Paint.Style.STROKE);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);

        canvas.translate(100, 100);

        Path path = new Path();

        path.addRect(-50, -50, 50, 50, Path.Direction.CW);

        Path dst=new Path();
        PathMeasure measure=new PathMeasure(path,false);
        measure.getSegment(0,170,dst,true);

        canvas.drawPath(dst, mPaint);



    }
}
